package com.hzit.controller;

import java.util.List;

import com.hzit.entity.Department;
import com.hzit.entity.Employee;
import com.hzit.service.EmployeeService;
import com.hzit.service.impl.EmployeeServiceImpl;

public class EmployeeAction {
	
	private EmployeeService employeeService = new EmployeeServiceImpl();
	private List<Employee> list;
	private List<Department> departments;
	private Employee employee;
	
	public List<Department> getDepartments() {
		return departments;
	}

	public void setDepartments(List<Department> departments) {
		this.departments = departments;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public List<Employee> getList() {
		return list;
	}

	public void setList(List<Employee> list) {
		this.list = list;
	}

	public String queryEmployees(){
		list = employeeService.queryAll();
		return "queryEmployees_ok";
	}
	
	public String add(){
		employeeService.add(employee);
		return "getAllEmployees";
	}
	
	public String delete(){
		employeeService.delete(employee);
		return "getAllEmployees";
	}
}